﻿#ifndef MYCONTROLLER_H
#define MYCONTROLLER_H

#include <QObject>
#include <QObject>
#include<QThread>
#include<QDebug>

class MyController : public QObject          //controller用于启动线程和处理线程执行结果
{
    Q_OBJECT
    QThread workerThread;
public:
    MyController(QObject *parent = nullptr);
    ~MyController();

signals:
    void operate(const int);                        //发送信号触发线程

public slots:
     void handleResults(const int rslt)                        //处理线程执行的结果
     {
         qDebug()<<"receive the resultReady signal---------------------------------";
         qDebug()<<"     current thread ID:"<<QThread::currentThreadId()<<'\n';
         qDebug()<<"     the last result is:"<<rslt;
     }
};

#endif // MYCONTROLLER_H
